package org.train.util;

public class RUtil{
    public static R success(Object object){
        R r = new R();
        r.setCode(Renum.SUCCESS.getCode());
        r.setMsg(Renum.SUCCESS.getMsg());
        r.setData(object);
        return r;
    }

    public static R success(){
        return success(null);
    }

    public static R error(Integer code, String msg){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        return r;
    }

    public static R error(Renum renum){
        R r = new R();
        r.setCode(renum.getCode());
        r.setMsg(renum.getMsg());
        return r;
    }
}
